Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@auth0/auth0-spa-js

Package Overview
Dependencies
Maintainers
45
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@auth0/auth0-spa-js

Auth0 SDK for Single Page Applications using Authorization Code Grant Flow with PKCE

  • 1.22.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
161K
decreased by-78.75%
Maintainers
45
Weekly downloads
 
Created

What is @auth0/auth0-spa-js?

@auth0/auth0-spa-js is a JavaScript library designed to handle authentication in single-page applications (SPAs) using Auth0. It provides a simple and secure way to integrate Auth0's authentication and authorization services into your SPA.

What are @auth0/auth0-spa-js's main functionalities?

Login

This feature allows users to log in to your application using Auth0. The code sample demonstrates how to create an Auth0 client and initiate a login redirect.

const auth0 = await createAuth0Client({
  domain: 'YOUR_DOMAIN',
  client_id: 'YOUR_CLIENT_ID'
});

await auth0.loginWithRedirect({
  redirect_uri: window.location.origin
});

Logout

This feature allows users to log out of your application. The code sample shows how to log out and redirect the user to the home page.

await auth0.logout({
  returnTo: window.location.origin
});

Get User Information

This feature retrieves the authenticated user's information. The code sample demonstrates how to get the user profile after authentication.

const user = await auth0.getUser();
console.log(user);

Token Handling

This feature handles token retrieval for authenticated requests. The code sample shows how to get an access token silently without redirecting the user.

const token = await auth0.getTokenSilently();
console.log(token);

Other packages similar to @auth0/auth0-spa-js

Keywords

FAQs

Package last updated on 12 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc